package com.lzw.breadknife.sample.ui;

import android.app.Dialog;
import android.content.Context;
import android.os.Bundle;
import android.view.View;

import androidx.annotation.NonNull;

import com.lzw.breadknife.BreadKnife;
import com.lzw.breadknife.Unbinder;


/**
 * author  : AWeiLoveAndroid
 * e-mail  : lzw460433675@163.com
 * github  : https://gitee.com/AWeiLoveAndroid/BreadKnife
 * project : BreadKnife
 */
public abstract class BaseDialog<T extends Unbinder> extends Dialog {
    T unBinder;
    public BaseDialog(@NonNull Context context) {
        super(context);
    }

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        View view=View.inflate(getContext(),attachLayouRes(),null);
        setContentView(view);
        unBinder= (T) BreadKnife.bind(this,view);
    }

    protected abstract int  attachLayouRes();
}
